package com.jkdz.spyke.rs
{
	import com.jkgh.remedy.core.client.*;
	import flash.utils.ByteArray;
	import flash.net.Socket;

	public class SpykeChatRoomProxy extends SpykeWidgetProxy implements SpykeChatRoom
	{

		public function SpykeChatRoomProxy(remoteeID:int, connection:RemedyClientServerConnection)
		{
			super(remoteeID, connection);
		}

		public function registerListener(a:SpykeChatRoomListener):void
		{
			connection.performRun(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 21);
				RemedyMOClassManager.INSTANCE.writeWithGraph(a, connection, new Vector.<Object>());

			});
		}

		public function renameRoom(a:String):void
		{
			connection.performRun(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 22);
				RemedyStringClassManager.INSTANCE.writeWithGraph(a, connection, new Vector.<Object>());

			});
		}

		public function getName(onReturn:Function/*String*/):void
		{
			connection.performCall(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 20);

			}, new RemedyFunctionSpecification(onReturn, RemedyStringClassManager.INSTANCE));
		}

		public function sendMessage(a:String):void
		{
			connection.performRun(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 23);
				RemedyStringClassManager.INSTANCE.writeWithGraph(a, connection, new Vector.<Object>());

			});
		}
	}
}
